package dontCare.gwtester.client.tool;

import com.google.gwt.user.client.ui.Composite;

public class SourceUrl {
	public static final String HOST = "http://code.google.com/p/";
	public static final String PROJECT = "gwtester";
	public static final String SOURCE_PATH = "/source/browse/src/";
	
	public static String genJava(Class<?> class1) {
		return HOST+PROJECT+SOURCE_PATH+convertToUrl(class1.getName())+".java";
	}

	public static String genUiXml(Class<? extends Composite> class1) {
		return HOST+PROJECT+SOURCE_PATH+convertToUrl(class1.getName())+".ui.xml";
	}
	
	private static String convertToUrl(String className){
		return className.replaceAll("[..]", "/");
	}
}
